<?php
/**
 * @package EDO
 * @subpackage Core
 *
 */
class EDO_searcher_subquery
{
	
	protected $searcher;
	protected $edo_object;
	
	protected $constraints;
	
	
	private $searchConditions = array();
	
		
	function __construct(EDO_searcher $searcher, $id, $type = "and")
	{
		$this->searcher = $searcher;
		$this->id = $id;
		$this->edo_object = $searcher->edo_object;
		
		$this->type = $type;
	}
	
	
	function process()
	{
		foreach($this->getConditions() as $paramkey => $condition)
		{
			$field = $this->edo_object->getFieldObject($condition->getField());
			$field->addSQLForQuery($this->searcher->query, $condition);
		}	
	}
	
	
	public function addCondition(SearchCondition $searchCond)
	{
		$this->searchConditions[] = $searchCond;
	}
	
	public function &getConditions()
	{
		return $this->searchConditions;
	}
	
	
	
}